import request from '@/utils/request'

// 查询通知设置列表
export function listNotificationSetting(query) {
  return request({
    url: '/env/notification/list',
    method: 'get',
    params: query
  })
}

// 查询通知设置详细
export function getNotificationSetting(settingId) {
  return request({
    url: '/env/notification/' + settingId,
    method: 'get'
  })
}

// 新增通知设置
export function addNotificationSetting(data) {
  return request({
    url: '/env/notification',
    method: 'post',
    data: data
  })
}

// 修改通知设置
export function updateNotificationSetting(data) {
  return request({
    url: '/env/notification',
    method: 'put',
    data: data
  })
}

// 删除通知设置
export function delNotificationSetting(settingId) {
  return request({
    url: '/env/notification/' + settingId,
    method: 'delete'
  })
}

// 获取当前用户通知设置
export function getCurrentUserNotificationSetting() {
  return request({
    url: '/env/notification/current',
    method: 'get'
  })
}

// 更新当前用户通知设置
export function updateCurrentUserNotificationSetting(data) {
  return request({
    url: '/env/notification/current',
    method: 'put',
    data: data
  })
}

// 初始化通知设置
export function initNotificationSetting() {
  return request({
    url: '/env/notification/init',
    method: 'post'
  })
}

// 检查报警条件
export function checkAlertCondition(data) {
  return request({
    url: '/env/notification/check-alert',
    method: 'post',
    data: data
  })
}

// 导出通知设置
export function exportNotificationSetting(query) {
  return request({
    url: '/env/notification/export',
    method: 'post',
    params: query
  })
}